<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:decorate template="/template/base.xhtml">

	<ui:define name="centro">
	<h:form id="teste" >
			<p:growl id="growl" showDetail="true" life="9000"/>  
			 <p:panel header="Projetcs List">
			 <h:panelGrid columns="2" columnClasses="label, value" >  
			  <h:outputText value="Select Project:" />
			  <p:selectOneMenu id="suiteteste" value="#{projectWizard.project.name}"  >
						        <f:selectItem itemLabel="Selecione" itemValue=""/>
						        <f:selectItems var="item" itemLabel="#{item.name}" itemValue="#{item.name}" value="#{projectWizard.listProjetcs}"/>
			  </p:selectOneMenu>
			   <p:commandButton value="Search Project"  
                            actionListener="#{projectWizard.populaTabela()}" update="teste"/> 
			 </h:panelGrid>
			 
    		</p:panel>  
			 <p:dataTable id="lazyDataTable" value="#{projectWizard.testSuitesGerXml}" var="prj" paginator="true" rows="10"
                paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                rowsPerPageTemplate="5,10,15" style="width: 80%;margin-left: 10%;margin-right: 10%;">
		                  <f:facet name="header">  
		                  	 Teste Case  
		        		  </f:facet>     
				        <p:column headerText="Name Project">  
				            <h:outputText value="#{prj.project.name}" />  
				        </p:column>  
				  
				        <p:column headerText="Test Suite">  
				            <h:outputText value="#{prj.name}" />  
				        </p:column>  
				  
				        <p:column headerText="Test Case">  
				            <h:outputText value="#{prj.testCase.name}" />  
				        </p:column> 
				  
				        <p:column headerText="Test Step">  
				            <h:outputText value="#{prj.testCase.testStep.name}" />  
				        </p:column>  
				  
				        <p:column headerText="Path">  
				            <h:outputText value="#{prj.testCase.testStep.config.resourcePath}" />  
				        </p:column>  
             </p:dataTable>
             <h:panelGrid columns="1" rendered="#{not empty projectWizard.testSuitesGerXml}" style="margin: 20px 400px 800px 150px;">  
    			<p:panel header="Export XML (XML SOAPUI)">  
    			  <p:commandButton actionListener="#{projectWizard.save()}" onclick="dlg2.show();" icon="buttonXMl" style="height: 40px; ">  
					            
				 </p:commandButton>
    			</p:panel>
    		</h:panelGrid>
    		<p:dialog id="modalDialog" header="Download Xml SOAPUI" widgetVar="dlg2" modal="false" height="100" showEffect="explode" >  
			   <p:dialog modal="false" widgetVar="statusDialog" header="Status" draggable="false" closable="false" resizable="false">  
					    <p:graphicImage value="/resources/images/ajaxloadingbar.gif" />  
			  </p:dialog>  
     				<p:commandButton id="downloadLink" value="Download" ajax="false" onclick="PrimeFaces.monitorDownload(start, stop)"   
					        icon="ui-icon-arrowthichk-s">  
					<p:fileDownload value="#{projectWizard.file}" />  
					</p:commandButton> 
			</p:dialog> 
             
	</h:form>
	</ui:define>
	</ui:decorate>
	</html>		